<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css">
<header>
    <script type="text/javascript">
    </script>
</header>
<body>


<div class="row">
    <div class="col-md-4" role="navigation">
        <!-- <h1 style="font-size: 20px;margin-top: 9px">东大咸鱼</h1> -->

        <ul class="nav nav-pills">
            <c:if test="${empty sessionScope.user}">
                <li><a href="${pageContext.request.contextPath}/login" style="color: #F22E00">请登录</a></li>
            </c:if>
            <c:if test="${!empty sessionScope.user}">
                <li class="info-a">
                    <a href="${pageContext.request.contextPath}/information" style="color: #F22E00">
                            ${sessionScope.user.username}
                        <span class="glyphicon glyphicon-triangle-bottom" style="font-size: 5px;margin-left: 7px;"
                              aria-hidden="true">
                    </span>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="${pageContext.request.contextPath}/information">账户管理</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="${pageContext.request.contextPath}/logout" class="login-out">退出登录</a></li>
                    </ul>
                </li>
            </c:if>

            <c:if test="${empty sessionScope.user}">
                <li><a href="${pageContext.request.contextPath}/register" style="color: #0f0f0f">注册</a></li>
            </c:if>
        </ul>
    </div>
    <div class="col-md-8">
        <ul class="nav nav-pills pull-right">
            <li><a class="a-color" href="${pageContext.request.contextPath}/information"
                   style="color: #0f0f0f">个人信息</a></li>
            <li class="dropdown"><a class="a-color" href="${pageContext.request.contextPath}/info/list"
                                    class="dropdown-toggle" data-toggle="dropdown" role="button"
                                    aria-haspopup="true" aria-expanded="false" style="color: #0f0f0f">我的订单 <span
                    class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath}/info/address" style="color: #0f0f0f">地址管理</a>
                    </li>
                    <li><a href="${pageContext.request.contextPath}/order" style="color: #0f0f0f">交易中</a></li>
                    <li role="separator" class="divider"></li>
                </ul>
            </li>
            <li><a href="${pageContext.request.contextPath}/showcart" style="color: #0f0f0f">
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                     class="bi bi-cart-check" viewBox="0 0 16 16">
                    <path d="M11.354 6.354a.5.5 0 0 0-.708-.708L8 8.293 6.854 7.146a.5.5 0 1 0-.708.708l1.5 1.5a.5.5 0 0 0 .708 0l3-3z"/>
                    <path d="M.5 1a.5.5 0 0 0 0 1h1.11l.401 1.607 1.498 7.985A.5.5 0 0 0 4 12h1a2 2 0 1 0 0 4 2 2 0 0 0 0-4h7a2 2 0 1 0 0 4 2 2 0 0 0 0-4h1a.5.5 0 0 0 .491-.408l1.5-8A.5.5 0 0 0 14.5 3H2.89l-.405-1.621A.5.5 0 0 0 2 1H.5zm3.915 10L3.102 4h10.796l-1.313 7h-8.17zM6 14a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm7 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
                </svg>
                购物车
            </a></li>
            <li><a href="${pageContext.request.contextPath}/info/favorite" style="color: #0f0f0f"> <i
                    class="fa fa-star"></i> 收藏夹
            </a></li>
        </ul>
    </div>
</div>
<div id="header-nav">
    <nav class="navbar navbar-default" id="header-nav-middle">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed"
                        data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1"
                        aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span> <span
                        class="icon-bar"></span> <span class="icon-bar"></span> <span
                        class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="${pageContext.request.contextPath}/main"><span
                        class="logo-word">云端花屋</span></a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse"
                 id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <c:forEach items="${categoryList}" var="categorys">
                        <li><a class="a-color"
                               href="${pageContext.request.contextPath}/category?cateId=${categorys.cateid}&cate=${categorys.catename}">${categorys.catename}</a>
                        </li>
                    </c:forEach>
                </ul>

                <form class="navbar-form navbar-right" role="search" method="get"
                      action="${pageContext.request.contextPath}/search">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="Search" name="keyword">
                        <input type="hidden" name="cateid" value="0">
                    </div>
                    <button type="submit" class="btn btn-default">
                        <span class="glyphicon glyphicon-search" aria-label="搜索"></span>
                    </button>
                </form>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container-fluid -->
    </nav>
</div>

</body>